package com.wt.admin.mapper.ai;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wt.admin.domain.dto.ai.KnowledgeInfoDTO;
import com.wt.admin.domain.entity.ai.KnowledgeInfoEntity;
import com.wt.admin.domain.vo.ai.KnowledgeInfoVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ChatModelFileMapper extends BaseMapper<KnowledgeInfoEntity> {

    @Delete("delete from ai_knowledge_info where knowledge_title_id = #{id}")
    void delByModelId(@Param("id") Integer id);

    @Select("select * from ai_knowledge_info where knowledge_title_id = #{data.knowledgeTitleId} order by create_time desc")
    List<KnowledgeInfoVO> modeFileList(@Param("data") KnowledgeInfoDTO data);

    @Select("select * from ai_knowledge_info")
    List<KnowledgeInfoEntity> listFile();
}
